home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group96b.txt / 000054_icon-group-sender _Thu Nov 7 10:05:05 1996.msg < prev    next >
Internet Message Format  |  1997-01-02  |  1KB

  1. Received: by cheltenham.cs.arizona.edu; Thu, 7 Nov 1996 12:45:17 MST
  2. Message-Id: <199611071816.TAA16271@manaslu.inforoute.cgs.fr>
  3. Comments: Authenticated sender is <grodzens@inforoute.cgs.fr>
  4. From: "Vladimir" <grodzens@InfoRoute.CGS.Fr>
  5. To: stephen parker <stephen@lila.york.ac.uk>
  6. Date: Thu, 7 Nov 1996 10:05:05 +0000
  7. Mime-Version: 1.0
  8. Content-Type: text/plain; charset=US-ASCII
  9. Content-Transfer-Encoding: 7BIT
  10. Subject: Re: sets and structures
  11. Cc: icon-group@cs.arizona.edu
  12. Priority: urgent
  13. X-Mailer: Pegasus Mail for Win32 (v2.42)
  14. Errors-To: icon-group-errors@cs.arizona.edu
  15.  
  16. On  7 Nov 96 at 7:14, you wrote:
  17.  
  18. > as you would expect for a list rather than a set.  so, what's the
  19. > answer if you want to form a set of non-atomic types?  do i have to
  20. > do it by hand?
  21.  
  22. It happens because your records are -equivalent- (having the same 
  23. values) but not -identical-. You can easily verify how it works.
  24.  
  25. Let's say S:= set()
  26.    rec_1:= rec(a, b)
  27.    insert(S, rec_1)
  28.    insert(S, rec_1)
  29. the set S still has one element.
  30.  
  31. Another experience:
  32.    rec_1:= rec(a, b)
  33.    insert(S, rec_1)
  34.    rec_2:= rec_1
  35.    insert(S, rec_2)
  36. The set S still has one element.
  37.  
  38. You can try another experience:
  39.    rec_1:= rec(a, b)
  40.    insert(S, rec_1)
  41.    rec_1:= rec(a, c) # assign a new value to rec_1
  42.    insert(S, rec_1)
  43. Here a new element has been inserted!
  44.  
  45.  
  46. BTW, why don't you have the Icon book? :-)
  47.  
  48.